<?php
/**
 * Introduction: banner关联表  advs_con
 */

namespace Common\Model;


use Think\Model;

class AdvsConModel extends Model
{
    //定义数据库连接信息
    protected $connection;

    //定义表名
    protected $tableName = 'advs_con';

    /**
     * 初始化
     */
    public function _initialize()
    {

        $this->connection = C('Databaese');

    }

    /**
     * 获取多条数据
     */
    public function getRow($advPosId){
        $fields = ['id','url','pic','con','catid','cat_type'];
        $time = time();
        $list = $this->where("group_id=$advPosId and isopen=1 and stime<=$time and etime>=$time")->field($fields)->order("sort_num asc")->select();

        return $list;
    }

}